#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#define int long long
#define y1 qazxsw
#define File(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout)
const int mod=0;
using namespace std;
int n,m,q,k,b[3000005],a[10],ans;
inline int check()
{
//	for(int i=1;i<=n;i++)
//		cout<<a[i]<<' ';
//	cout<<'\n';
	int sum=0;
	for(int i=1;i-m+1<=n;i++)
	{
		bool ok=1;
		for(int j=1,i2=i;j<=m;j++,i2++)
		{
			if(b[j]!=a[i2])
			{
				ok=0;
				break;
			}
		}
		sum+=ok;
	}
//	cerr<<"ANS:"<<sum<<"\n";
	return sum;
}
void dfs(int id)
{
	if(id>q)
	{
		ans+=check();
		ans%=998244353;
		return;
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=k;j++)
		{
			int tmp=a[i];
			a[i]=j;
			dfs(id+1);
			a[i]=tmp;
		}
	}	
}
signed main()
{
	File("sequence");
	ios::sync_with_stdio(false);
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cin>>n>>m>>q>>k;
	for(int i=1;i<=m;i++)
		cin>>b[i];
	if(q<m) 
		cout<<0; 
	else
	{
		dfs(1);
		cout<<ans;
	}
	return 0;
}

